home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
tcsel003.zip
/
BITMAP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-10-16
|
871b
|
31 lines
type
map = array[0..maxsize] of byte;
function BitSetInBitMap(var x; numb : longint): boolean;
{ Tests the numb bit in the bitmap array }
var m: map absolute x;
begin
BitSetInBitMap := odd(m[numb shr 3] shr (numb and 7));
end;
procedure SetBitInBitMap(var x; numb: word);
{ Sets the numb bit in the bitmap array }
var m: map absolute x;
begin
m[numb shr 3] := m[numb shr 3] or (1 shl (numb and 7))
end;
procedure ResetBitInBitMap(var x; numb : longint);
{ Resets the numb bit in the bitmap array }
var m: map absolute x;
begin
m[numb shr 3] := m[numb shr 3] and not(1 shl (numb and 7));
end;
procedure ToggleBitInBitMap(var x; numb : longint);
{ Toggles (flips) the numb bit in the bitmap array }
var m: map absolute x;
begin
m[numb shr 3] := m[numb shr 3] xor (1 shl (numb and 7));
end;